/*
 * UnitAnimalPosition.h
 *
 *  Created on: 2013-1-19
 *      Author: heqiu
 */

#ifndef UNITANIMALPOSITION_H_
#define UNITANIMALPOSITION_H_

#include "UnitAnimal.h"
#include <map>
#include <set>
#include <vector>
#include "GuudLock.h"
namespace guud {

class UnitAnimalPosition {
public:
	UnitAnimalPosition();
	void init(uint32_t uiLong);
	//获取当前坐标上的所有动物集合
	void getAnimal(uint32_t uiX, uint32_t uiY,
			std::vector<uint32_t> & vctAnimal);
	//删除动物
	void delAnimal(uint32_t uiId);
	//设置动物所处坐标
	void addAnimal(uint32_t uiId, uint32_t uiX, uint32_t uiY);
private:
	GuudLock m_lock;
	uint32_t m_uiLong;
	std::map<uint32_t, uint32_t> m_mapAnimal;
	std::map<uint32_t, std::set<uint32_t> > m_mapPos;
};
}

#endif /* UNITANIMALPOSITION_H_ */
